package com.ruoyi.shape.service.impl;

import java.util.List;

import com.ruoyi.common.constant.DicConstants;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.shape.domain.Shape;
import com.ruoyi.shape.mapper.ShapeMapper;
import com.ruoyi.shape.service.IShapeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 手型、脸型信息Service业务层处理
 *
 * @author ruoyi
 * @date 2024-03-08
 */
@Service
public class ShapeServiceImpl implements IShapeService
{
    @Autowired
    private ShapeMapper shapeMapper;

    /**
     * 查询手型、脸型信息
     *
     * @param id 手型、脸型信息主键
     * @return 手型、脸型信息
     */
    @Override
    public Shape selectShapeById(Long id)
    {
        return shapeMapper.selectShapeById(id);
    }

    /**
     * 查询手型、脸型信息列表
     *
     * @param shape 手型、脸型信息
     * @return 手型、脸型信息
     */
    @Override
    public List<Shape> selectShapeList(Shape shape)
    {
        return shapeMapper.selectShapeList(shape);
    }

    /**
     * 查询手型信息列表
     */
    @Override
    public List<Shape> selectHandShapeList(Shape shape) {
        return shapeMapper.selectHandShapeList(shape);
    }

    /**
     * 查询脸型信息列表
     */
    @Override
    public List<Shape> selectFaceShapeList(Shape shape) {
        return shapeMapper.selectFaceShapeList(shape);
    }

    /**
     * 新增手型、脸型信息
     *
     * @param shape 手型、脸型信息
     * @return 结果
     */
    @Override
    public int insertShape(Shape shape)
    {
        shape.setCreateBy(SecurityUtils.getUserId());
        shape.setCreateType(DicConstants.BUSINESS_Manager.getCode());
        shape.setCreateTime(DateUtils.getNowDate());
        return shapeMapper.insertShape(shape);
    }

    /**
     * 修改手型、脸型信息
     *
     * @param shape 手型、脸型信息
     * @return 结果
     */
    @Override
    public int updateShape(Shape shape)
    {
        shape.setUpdateBy(SecurityUtils.getUserId());
        shape.setUpdateType(DicConstants.BUSINESS_Manager.getCode());
        shape.setUpdateTime(DateUtils.getNowDate());
        return shapeMapper.updateShape(shape);
    }

    /**
     * 批量删除手型、脸型信息
     *
     * @param ids 需要删除的手型、脸型信息主键
     * @return 结果
     */
    @Override
    public int deleteShapeByIds(Long[] ids)
    {
        return shapeMapper.deleteShapeByIds(ids);
    }
    /**
     * 批量逻辑删除手型、脸型信息
     *
     * @param ids 需要删除的手型、脸型信息主键
     * @return 结果
     */
    @Override
    public int logicDeleteShape(Long[] ids,String delType,Long delUser)
    {
        return shapeMapper.logicDeleteShape(ids,delType,delUser);
    }

    /**
     * 删除手型、脸型信息信息
     *
     * @param id 手型、脸型信息主键
     * @return 结果
     */
    @Override
    public int deleteShapeById(Long id)
    {
        return shapeMapper.deleteShapeById(id);
    }
}
